package com.heaven.study.simplefactory;

public class Divide extends Operator {

    @Override
    public int calculate(int num1, int num2) throws Exception {
        if (num2 == 0) {
            throw new Exception("num2 cannot be 0");
        }
        return num1 / num2;
    }

}
